@echo off
echo 启动Celery服务...

REM 启动Redis服务（如果Redis未运行）
echo 检查Redis服务...
redis-server --daemonize yes 2>nul
if %errorlevel% neq 0 (
    echo Redis服务启动失败，请确保Redis已安装并配置正确
    pause
    exit /b 1
)

echo Redis服务已启动

REM 启动Celery Worker
echo 启动Celery Worker...
start "Celery Worker" cmd /k "celery -A boss worker -l info"

REM 等待2秒
timeout /t 2 /nobreak >nul

REM 启动Celery Beat
echo 启动Celery Beat...
start "Celery Beat" cmd /k "celery -A boss beat -l info"

echo Celery服务启动完成！
echo Worker和Beat已在新的命令行窗口中运行
echo 按任意键退出...
pause 